package com.example.demo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Objects;

/**
 * 功能描述：
 *
 * @Author: Zhanghf
 * @Date: 2021/12/11 12:05
 */

public class Chapter {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer bookid;
    private Integer chapterid;
    private String chaptername;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Chapter)) return false;
        Chapter chapter = (Chapter) o;
        return Objects.equals(bookid, chapter.bookid) &&
                Objects.equals(chapterid, chapter.chapterid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bookid, chapterid);
    }

    @Override
    public String toString() {
        return "Chapters{" +
                "id=" + id +
                ", bookid=" + bookid +
                ", chapterid=" + chapterid +
                ", chaptername='" + chaptername + '\'' +

                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBookid() {
        return bookid;
    }

    public void setBookid(Integer bookid) {
        this.bookid = bookid;
    }

    public Integer getChapterid() {
        return chapterid;
    }

    public void setChapterid(Integer chapterid) {
        this.chapterid = chapterid;
    }

    public String getChaptername() {
        return chaptername;
    }

    public void setChaptername(String chaptername) {
        this.chaptername = chaptername;
    }

    public Chapter(Integer bookid, Integer chapterid, String chaptername) {
        this.bookid = bookid;
        this.chapterid = chapterid;
        this.chaptername = chaptername;
    }

    public Chapter() {
    }
}
